package com.example.graph.service;


import com.example.graph.entity.Know;
import com.example.graph.entity.UserNode;

import java.util.List;
import java.util.Optional;

/**
 * @ClassName: UserService
 * @Description:
 * @Author: keke
 * @Date: 2021/6/7 11:25
 */
public interface UserService {

    /**
     * @Author keke
     * @Description 添加user节点
     * @Date 2021/6/7
     * @Param [userNode]
     * @Return com.example.neodemo.model.UserNode
     **/
    UserNode create(UserNode userNode);

    /**
     * @Author keke
     * @Description 根据id删除
     * @Date 2021/6/7
     * @Param [id]
     * @Return void
     **/
    void deleteById(Long id);

    /**
     * @Author keke
     * @Description 根据id查询
     * @Date 2021/6/7
     * @Param [id]
     * @Return java.util.Optional<com.example.neodemo.model.UserNode>
     **/
    Optional<UserNode> findById(long id);

    /**
     * @Author keke
     * @Description 获取所有User节点
     * @Date 2021/6/7
     * @Param []
     * @Return java.util.List<com.example.neodemo.model.UserNode>
     **/
    List<UserNode> findAll();

    /**
     * @Author keke
     * @Description 增加“知道”关系
     * @Date 2021/6/7
     * @Param [fromNode, toNode]
     * @Return com.example.neodemo.model.Know
     **/
    Know addIKnows(UserNode fromNode, UserNode toNode);

    /**
     * @Author keke
     * @Description 修改单个节点
     * @Date 2021/6/7
     * @Param [userNode]
     * @Return com.example.neodemo.model.UserNode
     **/
    UserNode updateByNode(UserNode userNode);

    /**
     * @Author keke
     * @Description 删除两个节点的关系
     * @Date 2021/6/7
     * @Param [fromId, toId]
     * @Return void
     **/
    void deleteKnowByNodeId(long fromId,long toId);

    void deleteAll();
}

